package com.tenton.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Date: 2021/1/18
 * @Author: Tenton
 * @Description: 用户数据
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
  /**
   * 用户Id
   */
  private Integer id;
  /**
   * 用户名
   */
  private String userName;
  /**
   * 密码
   */
  private String password;
  /**
   * 姓名
   */
  private String fullName;
  /**
   * 电话
   */
  private String tel;
  /**
   * 地址
   */
  private String address;
  /**
   * 所在国家
   */
  private String country;
  /**
   * 所在城市
   */
  private String city;
  /**
   * 邮箱
   */
  private String email;
  /**
   * 爱好
   */
  private String hobby;
  /**
   * 密保问题
   */
  private String problem;
  /**
   * 密保答案
   */
  private String answers;
  /**
   * 角色
   */
  private String role;
  /**
   * 创建时间
   */
  private String createTime;


  public User(String userName, String password, String fullName, String tel, String address, String country, String city, String email, String hobby, String problem, String answers) {
    this.userName = userName;
    this.password = password;
    this.fullName = fullName;
    this.tel = tel;
    this.address = address;
    this.country = country;
    this.city = city;
    this.email = email;
    this.hobby = hobby;
    this.problem = problem;
    this.answers = answers;
    //赋值当前时间
    //日期格式化
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date date = new Date();
    String format = sdf.format(date);
    this.createTime = format;
  }

  public User(Integer id, String userName, String password, String fullName, String tel, String address, String country, String city, String email, String hobby, String problem, String answers) {
    this.id = id;
    this.userName = userName;
    this.password = password;
    this.fullName = fullName;
    this.tel = tel;
    this.address = address;
    this.country = country;
    this.city = city;
    this.email = email;
    this.hobby = hobby;
    this.problem = problem;
    this.answers = answers;
  }
}
